package com.itxx.keyCase;

import java.io.*;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws IOException {
        /*
                键盘录入 用户名 密码 存储进文件
         */
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的用户名:");
        String userName = sc.nextLine();
        System.out.println("请输入你的密码:");
        String passWord = sc.nextLine();


        BufferedWriter bw = new BufferedWriter(new FileWriter("day12\\user.txt"));
        bw.write("用户名是:" + userName + "..." + "密码是:" + passWord);
        bw.flush();

        BufferedReader br = new BufferedReader(new FileReader("day12\\user.txt"));
        String s = br.readLine();
        System.out.println(s);
        //释放资源
        bw.close();
        br.close();

    }
}
